package Dao;

import bean.Doctor;
import bean.Office;

import java.util.List;

public class officeDao extends BaseDao{
    public List<Office> queryOffices() throws Exception {
        String sql = "SELECT officename,description,doctornum FROM office";
        return queryForList(Office.class,sql);
    }

    public Office queryOfficeByName(String name) {
        String sql = "SELECT officename,description,doctornum FROM office WHERE officename = ?";
        try {
            return queryForOne(Office.class,sql,name);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
